<extend name="template/base_index" />

<block name="area_header">

</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}
            <a class="btn btn-primary btn-sm" href="{:U('Admin/BbsForum/add',array('fup'=>I('fup',0)))}">添加版块</a>
            <php>if(isset($_GET['fup']))echo '<a class="btn btn-default btn-sm" href="javascript:history.go(-1);">返回</a>';</php>
            <table class="table table-striped table table-hover  table-condensed">
                <thead>
                <tr>
                    <th>
                        <input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />FID
                    </th>
                    <th>
                        版块名称
                    </th>
                    <th>
                        主题数-回帖数
                    </th>
                    <th>
                        版主
                    </th>
                    <th>
                        是否审核发帖
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                </thead>
                <tbody>
                <empty name="list">
                    <tr>
                        <td colspan="5" class="text-center">{:L('NO_DATA')}</td>
                    </tr>
                    <else/>
                    <volist name="list" id="vo">
                        <div class="subform_{$vo.fid} hide" >
                            <input type="hidden" name="fid" value="{$vo.fid}"/>
                            <input type="hidden" name="modnewposts" value="<eq name='vo.modnewposts' value='1'>0<else/>1</eq>"/>
                        </div>
                        <tr>
                            <td>
                                <input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" />{$vo.fid}
                            </td>
                            <td class="text-ellipsis">
                                {$vo.name}<br/>
                                <a href="{:U('Admin/Product/view',array('imgId'=>$vo['icon_id']))}" target="_blank" title="点击查看原图" data-toggle="tooltip">
                                    <img  class="thumbnail" src="{:U('Api/Picture/index',array('id'=>$vo['icon_id'],'size'=>60))}" width="60"/></a>
                            </td>
                            <td>
                                {$vo.threads}-{$vo.posts}
                            </td>
                            <td>
                                <a href="{:U('Admin/BbsForum/admin',array('fid'=>$vo['fid']))}" class="btn btn-sm btn-primary">管理版主</a>
                            </td>
                            <td>
                                <if condition="$vo.modnewposts eq 1" >
                                    已开启
                                    <else/>
                                    未开启
                                </if>
                            </td>
                            <td>
                                <eq name="vo.modnewposts" value="0">
                                    <a href="{:U('Admin/BbsForum/modnewposts')}" target-form="subform_{$vo.fid}" class="btn btn-sm btn-primary ajax-post">开启审核</a>
                                </eq>
                                <eq name="vo.modnewposts" value="1">
                                    <a href="{:U('Admin/BbsForum/modnewposts')}" target-form="subform_{$vo.fid}" class="btn btn-sm btn-primary ajax-post">取消审核</a>
                                </eq>
                                <a href="{:U('Admin/BbsForum/edit',array('fid'=>$vo['fid'],'fup'=>$vo['fup']))}" class="btn btn-sm btn-primary"><i class="fa fa-edit"></i>{:L('BTN_EDIT')}</a>
                                <a href="{:U('Admin/BbsForum/index',array('fup'=>$vo['fid']))}" class="btn btn-sm btn-primary">下级论坛</a>
                            </td>
                        </tr>

                    </volist>
                </empty>
                </tbody>
            </table>
            <div>{$show}</div>
        </div>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
</block>

<block name="area_footer">

</block>
